/*
 * @Description: 编辑弹窗配置（包含新增编辑）
 * @Author: HuiSir<https://gitee.com/huisir001>
 * @Date: 2021-11-05 11:41:30
 * @LastEditTime: 2025-08-08 10:36:41
 */
import { defineFormOptions } from "@/components/TablePage/predefined";
import { REG_EXP_PATTERN } from "@/ui";

export default defineFormOptions(() => [
  {
    label: "上级部门",
    key: "pid",
    slot: "editParent",
    default: null,
  },
  {
    label: "名称",
    component: "input",
    key: "name",
    props: {
      placeholder: "请输入部门名称",
    },
    rules: {
      required: true,
    },
  },
  {
    label: "负责人",
    component: "input",
    key: "leader",
    props: {
      placeholder: "请输入负责人",
    },
    rules: {
      required: true,
    },
  },
  {
    label: "电话",
    component: "input",
    key: "phone",
    props: {
      placeholder: "请输入手机号",
    },
    rules: {
      trigger: "blur",
      pattern: REG_EXP_PATTERN.mobile,
      message: "手机号填写错误",
    },
  },
  {
    label: "邮箱",
    component: "input",
    key: "email",
    props: {
      placeholder: "请输入邮箱",
    },
    rules: {
      trigger: "blur",
      pattern: REG_EXP_PATTERN.email,
      message: "邮箱填写错误",
    },
  },
  {
    label: "备注",
    component: "input",
    key: "remark",
    props: {
      type: "textarea",
    },
  },
]);
